
package ui.componentes;

import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.JTable;
import java.awt.Component;
import java.awt.Color;
import java.awt.Font;

public class MovimientoTableRenderer extends DefaultTableCellRenderer{

   public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
		      super.getTableCellRendererComponent (table, value, isSelected, hasFocus, row, column);

		         this.setOpaque(true);
		         if(((String)value).compareTo("") != 0 &&  column == 1){
			         this.setForeground(new Color(0, 112, 0));
			         this.setFont( new Font("Dialog", Font.BOLD, 12));
		         }else if(((String)value).compareTo("") != 0 &&  column == 2){
		        	 this.setForeground(Color.RED);
		        	 this.setFont( new Font("Dialog", Font.BOLD, 12));
		         }else{
		        	 this.setForeground(Color.BLACK);
		         }
		         return this;
		   }
}
